 
<div class="mws-panel grid_8 mws-collapsible  subjects">
  <div class="mws-panel-header">
     <span class="mws-i-24 i-table-1"><?php  echo __('Subject'); ?></span>
   <div class="mws-collapse-button mws-inset"><span></span></div>
 </div>
<div class="mws-panel-body" style="display: block; direction:rtl;">
  <div class="right_direction"> 
  <table class="mws-table">
      <tbody>
		<tr><td class="left_header"><?php echo __('Id'); ?></td>
		<td>
			<?php echo h($subject['Subject']['id']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Name'); ?></td>
		<td>
			<?php echo h($subject['Subject']['name']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Active'); ?></td>
		<td>
			<?php echo h($subject['Subject']['active']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Display Order'); ?></td>
		<td>
			<?php echo h($subject['Subject']['display_order']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Created'); ?></td>
		<td>
			<?php echo h($subject['Subject']['created']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Modified'); ?></td>
		<td>
			<?php echo h($subject['Subject']['modified']); ?>
			&nbsp;
		</td></tr>
	</tbody>
	</table>
</div>
</div>

<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Subject'), array('action' => 'edit', $subject['Subject']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Subject'), array('action' => 'delete', $subject['Subject']['id']), null, __('Are you sure you want to delete # %s?', $subject['Subject']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Subjects'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Subject'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Lessons'), array('controller' => 'lessons', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Lesson'), array('controller' => 'lessons', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Questions'), array('controller' => 'questions', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Question'), array('controller' => 'questions', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Question Groups'), array('controller' => 'question_groups', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Question Group'), array('controller' => 'question_groups', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Quizzes'), array('controller' => 'quizzes', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Quiz'), array('controller' => 'quizzes', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Study Levels'), array('controller' => 'study_levels', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Study Level'), array('controller' => 'study_levels', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Lessons'); ?></h3>
	<?php if (!empty($subject['Lesson'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Title'); ?></th>
		<th><?php echo __('Start Date'); ?></th>
		<th><?php echo __('Study Level Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Is Paid'); ?></th>
		<th><?php echo __('Price'); ?></th>
		<th><?php echo __('Display Order'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Updated'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Lesson'] as $lesson): ?>
		<tr>
			<td><?php echo $lesson['id']; ?></td>
			<td><?php echo $lesson['title']; ?></td>
			<td><?php echo $lesson['start_date']; ?></td>
			<td><?php echo $lesson['study_level_id']; ?></td>
			<td><?php echo $lesson['subject_id']; ?></td>
			<td><?php echo $lesson['is_paid']; ?></td>
			<td><?php echo $lesson['price']; ?></td>
			<td><?php echo $lesson['display_order']; ?></td>
			<td><?php echo $lesson['created']; ?></td>
			<td><?php echo $lesson['updated']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'lessons', 'action' => 'view', $lesson['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'lessons', 'action' => 'edit', $lesson['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'lessons', 'action' => 'delete', $lesson['id']), null, __('Are you sure you want to delete # %s?', $lesson['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Lesson'), array('controller' => 'lessons', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Questions'); ?></h3>
	<?php if (!empty($subject['Question'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Body'); ?></th>
		<th><?php echo __('Image'); ?></th>
		<th><?php echo __('Question Type'); ?></th>
		<th><?php echo __('Points'); ?></th>
		<th><?php echo __('Question Group Id'); ?></th>
		<th><?php echo __('Study Level Id'); ?></th>
		<th><?php echo __('Lesson Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Quiz Id'); ?></th>
		<th><?php echo __('Display Order'); ?></th>
		<th><?php echo __('Active'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Question'] as $question): ?>
		<tr>
			<td><?php echo $question['id']; ?></td>
			<td><?php echo $question['body']; ?></td>
			<td><?php echo $question['image']; ?></td>
			<td><?php echo $question['question_type']; ?></td>
			<td><?php echo $question['points']; ?></td>
			<td><?php echo $question['question_group_id']; ?></td>
			<td><?php echo $question['study_level_id']; ?></td>
			<td><?php echo $question['lesson_id']; ?></td>
			<td><?php echo $question['subject_id']; ?></td>
			<td><?php echo $question['quiz_id']; ?></td>
			<td><?php echo $question['display_order']; ?></td>
			<td><?php echo $question['active']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'questions', 'action' => 'view', $question['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'questions', 'action' => 'edit', $question['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'questions', 'action' => 'delete', $question['id']), null, __('Are you sure you want to delete # %s?', $question['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Question'), array('controller' => 'questions', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Question Groups'); ?></h3>
	<?php if (!empty($subject['QuestionGroup'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Body'); ?></th>
		<th><?php echo __('Image'); ?></th>
		<th><?php echo __('Study Level Id'); ?></th>
		<th><?php echo __('Lesson Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Quiz Id'); ?></th>
		<th><?php echo __('Display Order'); ?></th>
		<th><?php echo __('Active'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['QuestionGroup'] as $questionGroup): ?>
		<tr>
			<td><?php echo $questionGroup['id']; ?></td>
			<td><?php echo $questionGroup['body']; ?></td>
			<td><?php echo $questionGroup['image']; ?></td>
			<td><?php echo $questionGroup['study_level_id']; ?></td>
			<td><?php echo $questionGroup['lesson_id']; ?></td>
			<td><?php echo $questionGroup['subject_id']; ?></td>
			<td><?php echo $questionGroup['quiz_id']; ?></td>
			<td><?php echo $questionGroup['display_order']; ?></td>
			<td><?php echo $questionGroup['active']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'question_groups', 'action' => 'view', $questionGroup['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'question_groups', 'action' => 'edit', $questionGroup['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'question_groups', 'action' => 'delete', $questionGroup['id']), null, __('Are you sure you want to delete # %s?', $questionGroup['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Question Group'), array('controller' => 'question_groups', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Quizzes'); ?></h3>
	<?php if (!empty($subject['Quiz'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Title'); ?></th>
		<th><?php echo __('Quiz Type'); ?></th>
		<th><?php echo __('Start Date'); ?></th>
		<th><?php echo __('Study Level Id'); ?></th>
		<th><?php echo __('Lesson Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Updated'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Quiz'] as $quiz): ?>
		<tr>
			<td><?php echo $quiz['id']; ?></td>
			<td><?php echo $quiz['title']; ?></td>
			<td><?php echo $quiz['quiz_type']; ?></td>
			<td><?php echo $quiz['start_date']; ?></td>
			<td><?php echo $quiz['study_level_id']; ?></td>
			<td><?php echo $quiz['lesson_id']; ?></td>
			<td><?php echo $quiz['subject_id']; ?></td>
			<td><?php echo $quiz['created']; ?></td>
			<td><?php echo $quiz['updated']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'quizzes', 'action' => 'view', $quiz['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'quizzes', 'action' => 'edit', $quiz['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'quizzes', 'action' => 'delete', $quiz['id']), null, __('Are you sure you want to delete # %s?', $quiz['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Quiz'), array('controller' => 'quizzes', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Study Levels'); ?></h3>
	<?php if (!empty($subject['StudyLevel'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Title'); ?></th>
		<th><?php echo __('Start Date'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Is Paid'); ?></th>
		<th><?php echo __('Price'); ?></th>
		<th><?php echo __('Display Order'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Updated'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['StudyLevel'] as $studyLevel): ?>
		<tr>
			<td><?php echo $studyLevel['id']; ?></td>
			<td><?php echo $studyLevel['title']; ?></td>
			<td><?php echo $studyLevel['start_date']; ?></td>
			<td><?php echo $studyLevel['subject_id']; ?></td>
			<td><?php echo $studyLevel['is_paid']; ?></td>
			<td><?php echo $studyLevel['price']; ?></td>
			<td><?php echo $studyLevel['display_order']; ?></td>
			<td><?php echo $studyLevel['created']; ?></td>
			<td><?php echo $studyLevel['updated']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'study_levels', 'action' => 'view', $studyLevel['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'study_levels', 'action' => 'edit', $studyLevel['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'study_levels', 'action' => 'delete', $studyLevel['id']), null, __('Are you sure you want to delete # %s?', $studyLevel['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Study Level'), array('controller' => 'study_levels', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
